package com.qinsong.myapplication.controller.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;

import com.hyphenate.easeui.EaseConstant;
import com.hyphenate.easeui.ui.EaseChatFragment;
import com.qinsong.myapplication.R;

public class ChatActivity extends FragmentActivity {


    private String hxid;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chat);
        initData();

    }

    /**
     * 初始化数据
     */
    private void initData() {
        //创建一个会话的Fragment，从环信获取
        EaseChatFragment easeChatFragment = new EaseChatFragment();

        hxid = getIntent().getStringExtra(EaseConstant.EXTRA_USER_ID);

        easeChatFragment.setArguments(getIntent().getExtras());
        //替换fragment
        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        fragmentTransaction.replace(R.id.fl_chat,easeChatFragment).commit();

    }
}
